#ifndef SIMPLEBUTTON_HPP_INCLUDED
#define SIMPLEBUTTON_HPP_INCLUDED

#include "SDL.h"
#include "common.hpp"
#include "zj_string.hpp"
#include "SimpleImage.hpp"

class SimpleButton {
    public:
        SimpleButton();
        ~SimpleButton();

        void init(AppState* app_state, const char* text);
        void handle(const SDL_Event& event);
        void update();
        void draw();

        bool clicked;
        int x, y;
        int w, h;

    private:
        AppState* app_state;
        bool cursor_downed; //是否按下过？
        SimpleImage img_text;
        SDL_Color color1;
        SDL_Color color2;
        SDL_Color color3;
        int button_state;   //状态：1：一般，2：触摸，3：按下
};


#endif // SIMPLEBUTTON_HPP_INCLUDED
